package sg.edu.nus.iss.phoenix.schedule.delegate;

import java.sql.Date;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Map;

import sg.edu.nus.iss.phoenix.schedule.entity.ProgramSlot;
import sg.edu.nus.iss.phoenix.schedule.entity.Schedule;
import sg.edu.nus.iss.phoenix.schedule.service.ScheduleService;
/**
 * 
 * @author Goh Zhe Yi, Ramprasad, Karthic Kumar, Gayathri
 *
 */
public class ScheduleDelegate {
	private ScheduleService service;
	
	public ScheduleDelegate() {
		super();
		service = new ScheduleService();
	}
	
	public void createProgramSlot(ProgramSlot programSlot) throws Exception{
		service.createProgramSlot(programSlot);
	}
	
	public void modifyProgramSlot(ProgramSlot programSlot) throws SQLException{
		service.modifyProgramSlot(programSlot);
	}
	
	public void createSchedule(Schedule schedule){
		service.createSchedule(schedule);
	}
	
	public void modifySchedule(Schedule schedule){
		service.modifySchedule(schedule);
	}
	
	public void deleteSchedule(Schedule schedule){
		service.deleteSchedule(schedule);
	}
	
	public void deleteProgramSlot(int programSlotId)  throws Exception{
		service.deleteProgramSlot(programSlotId);
	}
	
	public Schedule getSchedule(String date) throws Exception{
		return service.getSchedule(date);
	}
	
	public Map<Date, Schedule> getWeeklySchedule(Date date) throws Exception{
		return service.getWeeklySchedule(date);
	}
	
	public ArrayList<Schedule> getScheduleList(Date startDate,Date endDate) throws Exception{	
		return service.getScheduleList(startDate,endDate);
	}

	public Map<Date, Schedule> CopyWeeklySchedule(Date fromDate, Date toDate) throws Exception {
		return service.CopyWeeklySchedule(fromDate, toDate);
	}
	
	public void validateProgramSlot(ProgramSlot programSlot) throws Exception{
		service.validateProgramSlot(programSlot);
	}
	
	public void validateToSaveSchedule(java.util.Date startTime, java.util.Date endTime) throws Exception{	
		service.validateToSaveSchedule(startTime,endTime);
	}
}
